<?php

declare(strict_types=1);

namespace app\index\job;

use think\queue\Job;
use addons\Target\facade\Target;

class EquityJob
{


    public function fire(Job $job, $data)
    {
        // 你的代码逻辑...
        try {
            Target::Account()->basics($data['uid'], $data['bonus_k'], $data['bonus_data'], $data['title'], '+')
                ->createNormal();
            if ($job->attempts() > 3) {
                // 如果尝试超过3次则退出
                $job->delete();
                return;
            }
            $job->delete();
        } catch (\Exception $e) {
            $job->delete();
        }

        // 或者根据业务需求，重新推送任务
        // $job->release($delay); // $delay为延迟时间
    }
}
